{{define "system/system_user_edit.html"}}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改操作员密码</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
{{template "include/styleRefer.html"}}
    <link rel="stylesheet" href="/res/plugins/iCheck/all.css">
{{template "include/scriptRefer.html"}}
    <script src="/res/plugins/iCheck/icheck.min.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
{{template "mainHeader.html"}}
{{template "nav.html"}}
    <div class="content-wrapper">
    {{template "contentHeader.html"}}
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <form class="form-horizontal" id="systemUserAddForm">
                        <div class="box box-info" style="box-shadow: none;margin-bottom: 0;">
                            <div class="box-header with-border">
                                <h3 class="box-title">修改管理员密码</h3>
                            </div>
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="name" class="col-sm-2 control-label">姓名：</label>
                                    <div class="col-sm-4">
                                        <input type="text" name="name" class="form-control" id="name"
                                               placeholder="姓名" disabled>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="organName" class="col-sm-2 control-label">所属机构：</label>
                                    <div class="col-sm-4">
                                        <input type="text"  class="form-control" name="organName" id="organName"  disabled/>
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label for="account" class="col-sm-2 control-label">账号:</label>
                                    <div class="col-sm-4">
                                        <input type="text" name="account" class="form-control" id="account"
                                               placeholder="账号" disabled>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="password" class="col-sm-2 control-label">原密码:</label>
                                    <div class="col-sm-4">
                                        <input type="password" name="oldPassword" class="form-control" id="oldPassword"
                                               placeholder="原密码">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="password" class="col-sm-2 control-label">新密码:</label>
                                    <div class="col-sm-4">
                                        <input type="password" name="newPassword" class="form-control" id="newPassword"
                                               placeholder="新密码">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="password" class="col-sm-2 control-label">确认新密码:</label>
                                    <div class="col-sm-4">
                                        <input type="password" name="confirmNewPassword" class="form-control" id="confirmNewPassword"
                                               placeholder="确认新密码">
                                    </div>
                                </div>
                            </div>
                            <div class="box-footer">
                                <button type="button" class="btn btn-info middleBtn" id="systemUserEditSubmitBtn">提交
                                </button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </section>
    </div>
</div>

<script>
    $(function () {
        let organName={{.organName}};
        let name={{.name}};
        let account={{.account}};

        $("#organName").val(organName);
        $("#name").val(name);
        $("#account").val(account);
        $('#systemUserEditSubmitBtn').click(editSystemUser);
    });

    function editSystemUser() {
        let account = $("#account").val();
        let oldPassword = $("#oldPassword").val();
        let newPassword =  $("#newPassword").val();
        ajaxLoading("正在提交数据...");
        $.post("/system/user/editUser", {account:account,oldPassword:oldPassword,newPassword:newPassword}, function (resp) {
            ajaxLoadEnd();
            alert(resp.msg);
        });
    }
</script>
</body>
</html>
{{end}}